package com.pig4cloud.pig.demo.Service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.pig4cloud.pig.demo.Mapper.ViewMapper;
import com.pig4cloud.pig.demo.Service.ViewService;
import com.pig4cloud.pig.demo.feign.Entity.View;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ViewServiceImpl implements ViewService {
    @Autowired
    private ViewMapper viewMapper;

    @Override
    public int getNumsByAid(Long aid) {
        if (aid == null)
            return 0;
        return viewMapper.getNumsByAid(aid);
    }

    @Override
    public int insertView(View view) {
        return viewMapper.insert(view);
    }
}
